package com.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 文件存储配置
 */
@Configuration
public class FileStorageConfig {
    @Value("${file.upload-path}")
    private String uploadDir; // 上传文件的目录
    @Bean
    public Path fileStoragePath(){
        return Paths.get(uploadDir).toAbsolutePath().normalize();
    }
}
